package com.example.controller;

import com.example.pojo.Role;
import com.example.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class RoleController {
    @Resource
    private RoleService roleService;

    @GetMapping("/roleList")
    public List<Role> roleList(){ return roleService.roleList(); }

    @GetMapping("/getRoleByname/{rname}")
    public List<Role> getRoleByname(@PathVariable("rname") String rname){ return roleService.getRoleByname(rname); }
}
